import { defineStore } from 'pinia';
import { M } from 'vite/dist/node/types.d-aGj9QkWt';


export const systemStore = defineStore('system', {
  state: () => ({
        userFlag:false,
        userId:"",
        rolesFlag:false,
        rolesId:"",
        authFlag:false,
        authId:"",
        avatar_url:"",
        name:"",
        color:"",
        background:"",
        userObj:{}
  }),
  persist:true,
  actions: {
    setUserFlag(userFlag: Boolean) {
      this.userFlag = userFlag
    },
    setUserId(userId: string) {
      this.userId = userId;
    },
    setRolesFlag(rolesFlag: Boolean) {
      this.rolesFlag = rolesFlag;
    },
    setRolesId(rolesId: string) {
      this.rolesId = rolesId;
    },
    setAuthFlag(authFlag: Boolean) {
      this.authFlag = authFlag;
    },
    setAuthId(authId: string) {
      this.authId = authId;
    },
    setAvatarUrl(avatar_url: string) {
      this.avatar_url = avatar_url;
    },
    setName(name: string) {
      this.name = name;
    },
    setColor(color: string) {
      this.color = color;
    },
    setBackground(background: string) {
      this.background = background;
    },
    setUserobj(userObj: object) {
      this.userObj = userObj;
    },
  },
});